<meta charset="UTF-8">
<div class="content-wrapper">
	<!-- Content Header (Page header) -->
	<section class="content-header">
		<h1 style="text-align:center">
        	剩菜登记
      </h1>
	</section>

	<!-- Main content -->
	<section class="content">
		<div class="row">
			<div class="col-md-12">
				<div class="box">
					<div class="box-header">

						<div class='col-md-2'>
							<input type="text" class="form-control" id="datepicker" ng-model="searchNewLeftoverBy.datetime">
						</div>
						<div class="col-md-2 btn-group">
							<select class="form-control" ng-model="searchNewLeftoverBy.windows" ng-options="w.id as w.name for w in newleftWindows">
								<option value="" selected hidden>
							</select>
						</div>
						<div class="col-md-2 btn-group">
							<select class="form-control" ng-model="searchNewLeftoverBy.period_times" ng-options="p.id as p.name for p in newleftPeriods">
								<option value="" selected hidden>
							</select>
						</div>
						<!--<div class="col-md-2 btn-group">
							<input class="form-control" placeholder="菜品名" ng-model="searchNewLeftoverBy.item_name">
						</div>-->
						<div class="col-md-6" align="right">
						  
							<button class="btn btn-default pull-left" ng-click="searchNewLeftover()"><i class="fa fa-search"></i>&nbsp;&nbsp;查询</button>
						
							<button class="btn btn-primary" ng-click="submitLeftover()"><i class="fa fa-check"></i>&nbsp;&nbsp;提交</button>
						  
							<button class="btn btn-info" ng-click="jump_back()"><i class="fa fa-reply"></i>&nbsp;&nbsp;返回</button>
						 
							<button class="btn " ng-click="download('tb_newLeftover','剩菜登记')"><i class="fa fa-cloud-download"></i>&nbsp;&nbsp;导出</button>
						  
						 </div>
					</div>
					<div class="box-body table-responsive no-padding">
						<table class="table table-hover">
							<tbody>
								<tr>
									<th>菜品编号</th>
									<th>菜品名称</th>
									<th>档口</th>
									<th>单位</th>
									<th>单价</th>
									<th>计划数量</th>
									<th>销售数量</th>
									<th>剩菜数量</th>
								</tr>
								<tr ng-repeat = " n in newLeftOver track by $index">
									<td>{{$index+1}}</td>
									<td>{{n.item_name}}</td>
									<td>{{n.windows}}</td>
									<td>{{n.unit}}</td>
									<td>{{n.price}}</td>
									<td>{{n.planned_number}}</td>
									<td>{{n.sales_number}}</td>
									<td>
										<input type="number" style="width: 80%;text-align: center;" ng-model="n.register_number" ng-blur="vlidateNum(n.register_number,n.planned_number)"/>
									</td>
								</tr>
							</tbody>

						</table>
						<!-- //用于导出的表格-->
						<table class="table table-hover download" id="tb_newLeftover">
							<tbody>
								<tr>
									<td>菜品编号</td>
									<td>菜品名称</td>
									<td>档口</td>
									<td>单位</td>
									<td>单价</td>
									<td>计划数量</td>
									<td>销售数量</td>
									<td>剩菜数量</td>
								</tr>
							</tbody>
						</table>
					</div>
					<!-- /.box-body -->
					<div class="box-footer" style="margin-bottom:10px;">

						<div class="dataTables_info col-md-2" id="example1_info" role="status" aria-live="polite">总条数：{{totalNums}}</div>
						<div class="col-md-6 col-md-offset-4">
							<ul class="pagination pull-right" style="margin: 0px;">
								<li class="paginate_button previous" id="example1_previous">
									<a ng-click="Previous()">上一页</a>
								</li>
								<li ng-repeat="page in pageList" ng-class="{active: isActivePage(page)}">
									<a ng-click="selectPage(page)">{{page}}</a>
								</li>
								<li class="paginate_button next" id="example1_next">
									<a ng-click="Next()">下一页</a>
								</li>
							</ul>
						</div>

					</div>
				</div>
				<!-- /.box -->
			</div>
		</div>
	</section>
	<!-- /.content -->
</div>
<div class="modal fade" id="alertDate" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">提示</h4>
      </div>
      <div class="modal-body">
        	确定对{{leftOverDate}}日进行剩菜登记嘛？
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary" ng-click="sureSubmitLeftover()">确定</button>
      </div>
    </div>
  </div>
</div>